Index | Conventions

api/v1/jobs/{jobno}/labour

Path: api/v1/jobs/{jobno}/labour

This API is JSON:API compliant.

This endpoint supports the following methods:
GET POST PATCH

This endpoint requires an OAuth bearer token, and returns errors in a standard shape. See API Conventions for authentication, error responses and paging, which apply to every endpoint.

The resource type for this endpoint is JobLabour
The identifier is jobno-lineid

Attributes

The JobLabour resource type attributes are as follows:

AttributeTypeRead-onlyDescription
addDatestring (DateTime in ISO format)The date and time the labour entry was created.
addInitstringThe initials of the user who created the labour entry.
commentstringThe labour comment.
hoursintegerThe number of hours of labour.
labourInitstringThe initials of the staff member who performed the labour.
labourTypestringThe labour type.
minutesintegerThe number of minutes of labour.
modifyDatestring (DateTime in ISO format)The date and time the labour entry was last modified.
modifyInitstringThe initials of the user who last modified the labour entry.
startstring (DateTime in ISO format)The labour start date and time.

Example GET (Return all)

Path: api/v1/jobs/10/labour

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

This is a list. To keep the example readable, only the first item below is written out; the later items have been trimmed down in this documentation. In a real response each item comes back with the data applicable to that record (as described above).

Side-loading related resources with the include query parameter is not supported on list endpoints: an include parameter is ignored here and no included section is returned. To retrieve a related resource, request it directly using the id shown in each item's relationships, or use the single-resource (get by id) endpoint, which does support include.

{
    "data": [
        {
            "id": "10-2",
            "type": "JobLabour",
            "attributes": {
                "start": "2025-03-25T18:20:00",
                "hours": 0,
                "minutes": 5,
                "labourType": "Workshop",
                "labourInit": "SYS",
                "comment": "Replaced faulty power supply",
                "addInit": "SYS",
                "addDate": "2025-03-25T18:10:00",
                "modifyInit": "SYS",
                "modifyDate": "2025-03-25T18:10:00"
            }
        },
        {
            "id": "10-1",
            "type": "JobLabour",
            "attributes": {
                "labourType": "Admin",
                "comment": "Did some admin"
            }
        }
    ]
}

Example GET (Return specific)

Path: api/v1/jobs/10/labour/10-1

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

{
    "data": {
        "id": "10-1",
        "type": "JobLabour",
        "attributes": {
            "start": "2025-03-10T18:10:00",
            "hours": 0,
            "minutes": 10,
            "labourType": "Admin",
            "labourInit": "SYS",
            "comment": "Did some admin",
            "addInit": "SYS",
            "addDate": "2025-03-25T18:10:00",
            "modifyInit": "SYS",
            "modifyDate": "2025-03-25T18:10:00"
        },
      "links": {
        "self": "/api/v1/jobs/10/labour/10-1"
      }
    }
}

Example POST

Path: api/v1/jobs/10/labour

Request:

{
    "data": {
        "type": "JobLabour",
        "attributes": {
            "start": "2025-03-10T18:10:00",
            "hours": 0,
            "minutes": 10,
            "labourType": "Admin",
            "labourInit": "SYS",
            "comment": "New labour"
        }
    }
}

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

{
    "data": {
        "id": "10-3",
        "type": "JobLabour",
        "attributes": {
            "start": "2025-03-10T18:10:00",
            "hours": 0,
            "minutes": 10,
            "labourType": "Admin",
            "labourInit": "SYS",
            "comment": "New labour",
            "addInit": "API",
            "addDate": "2025-03-25T18:19:56.896909+11:00",
            "modifyInit": "API",
            "modifyDate": "2025-03-25T18:19:56.896909+11:00"
        },
      "links": {
        "self": "/api/v1/jobs/10/labour/10-3"
      }
    }
}

Example PATCH

Path: api/v1/jobs/10/labour/10-1

Request:

{
    "data": {
        "id": "10-1",
        "type": "JobLabour",
        "attributes": {
            "start": "2025-03-10T18:10:00",
            "hours": 0,
            "minutes": 10,
            "labourType": "Admin",
            "labourInit": "SYS",
            "comment": "Did some admin"
        }
    }
}

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

{
    "data": {
        "id": "10-1",
        "type": "JobLabour",
        "attributes": {
            "start": "2025-03-10T18:10:00",
            "hours": 0,
            "minutes": 10,
            "labourType": "Admin",
            "labourInit": "SYS",
            "comment": "Did some admin 22",
            "addInit": "SYS",
            "addDate": "2025-03-25T18:10:00",
            "modifyInit": "SYS",
            "modifyDate": "2025-03-25T18:10:00"
        },
      "links": {
        "self": "/api/v1/jobs/10/labour/10-1"
      }
    }
}